/******************************************************************************
 *  Copyright 2013 Bernhard Grünewaldt                                        *
 *                                                                            *
 *  Licensed under the Apache License, Version 2.0 (the "License");           *
 *  you may not use this file except in compliance with the License.          *
 *  You may obtain a copy of the License at                                   *
 *                                                                            *
 *      http://www.apache.org/licenses/LICENSE-2.0                            *
 *                                                                            *
 *  Unless required by applicable law or agreed to in writing, software       *
 *  distributed under the License is distributed on an "AS IS" BASIS,         *
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  *
 *  See the License for the specific language governing permissions and       *
 *  limitations under the License.                                            *
 ******************************************************************************/
package com.google.code.greenwood.confluencemavenreleaseinfomacro.pojo;

import java.util.Date;
import java.util.Map;

import com.atlassian.confluence.core.ConfluenceActionSupport;
import com.atlassian.confluence.renderer.radeox.macros.MacroUtils;
import com.atlassian.confluence.util.velocity.VelocityUtils;
import com.atlassian.sal.api.message.I18nResolver;

/**
 * This class exists, so that static method calls on confluence classes or any other classes can be better mocked.
 *  
 * @author bg
 *
 */
public class StaticClassWrapper implements StaticClassWrapperInterface {

	private I18nResolver i18n;
	  
    public String i18n_getText(String key) {
        String result = key;
        result = i18n.getText(key); 
        return result;
    }
    
    public String i18n_getText(String key, String[] params) {
        String result = key; 
        result = i18n.getText(key, params); 
        return result;
    }
    
    public Map<String, Object> macroUtils_defaultVelocityContext() {
    	return MacroUtils.defaultVelocityContext();
    }
    
    public String velocityUtils_getRenderedTemplate(String str, Map<String, Object> ctx) {
    	return VelocityUtils.getRenderedTemplate(str, ctx);
    }
    
    public Date newDate() { 
    	return new Date();
    }
 
    
    public void setI18nResolver(I18nResolver i18n) {
        this.i18n = i18n;
    }
    
    
    
}
